Class CiscoDeviceImpl

All Implemented Interfaces:
IPCObject, CiscoDevice, Device
Direct Known Subclasses:
ASAImpl, RouterImpl

public class CiscoDeviceImpl extends DeviceImpl implements CiscoDevice
Information provided by the PKI file:

    \class CiscoDevice
    
    \brief CiscoDevice is any Cisco-branded device with a terminal line.
    
    \example network().getDevice("Router0")
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • setHostName

      public void setHostName(String hostname)
      Information provided by the PKI file:
      
          \brief Sets the hostname of this device with the specified string.
          
          \param string, the hostname string.
          
              
      Specified by:
      setHostName in interface CiscoDevice
      Parameters:
      hostname - Takes in a parameter of hostname
    • getHostName

      public String getHostName()
      Information provided by the PKI file:
      
          \brief Returns the hostname of this device.
          
          \return string, the hostname of this device.
          
              
      Specified by:
      getHostName in interface CiscoDevice
      Returns:
      String Returns a String
    • setEnableSecret

      public void setEnableSecret(String password)
      Information provided by the PKI file:
      
          \brief Sets the encrypted enable secret password with the specified string.
          
          \param string, the encrypted secret password string.
          
              
      Specified by:
      setEnableSecret in interface CiscoDevice
      Parameters:
      password - Takes in a parameter of password
    • getEnableSecret

      public String getEnableSecret()
      Information provided by the PKI file:
      
          \brief Returns the encrypted enable secret string.
          
          \return string, the encrypted enable secret string.
          
              
      Specified by:
      getEnableSecret in interface CiscoDevice
      Returns:
      String Returns a String
    • setEnablePassword

      public void setEnablePassword(String password, int level)
      Information provided by the PKI file:
      
          \brief Sets the enable password.
          
          \param password, the clear text password string.
          
          \param level, the level must be 7 or 0. 7 is hidden.
          
              
      Specified by:
      setEnablePassword in interface CiscoDevice
      Parameters:
      password - Takes in a parameter of password
      level - Takes in a parameter of level
    • getEnablePassword

      public String getEnablePassword()
      Information provided by the PKI file:
      
          \brief Returns the enable password.
          
          \return string, the enable password.
          
              
      Specified by:
      getEnablePassword in interface CiscoDevice
      Returns:
      String Returns a String
    • setStartupFile

      public void setStartupFile(String str)
      Information provided by the PKI file:
      
          \brief Sets the startup file to the specified file.
          
          \param str, the filename of the config file.
          
              
      Specified by:
      setStartupFile in interface CiscoDevice
      Parameters:
      str - Takes in a parameter of str
    • getStartupFile

      public List<String> getStartupFile()
      Information provided by the PKI file:
      
          \brief Returns the contents of the current startup file.
          
          \return vector<string>, the contents of the current startup file.
          
              
      Specified by:
      getStartupFile in interface CiscoDevice
      Returns:
      List<String> Returns a List<String>
    • addBootSystem

      public boolean addBootSystem(String name)
      Information provided by the PKI file:
      
          \brief Modifies the system parameters to add a particular boot system image.
          
          \param name, the boot system name.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      addBootSystem in interface CiscoDevice
      Parameters:
      name - Takes in a parameter of name
      Returns:
      boolean Returns a boolean
    • removeBootSystem

      public boolean removeBootSystem(String name)
      Information provided by the PKI file:
      
          \brief Removes the specified boot system from this device.
          
          \param name, the boot system name.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      removeBootSystem in interface CiscoDevice
      Parameters:
      name - Takes in a parameter of name
      Returns:
      boolean Returns a boolean
    • removeAllBootSystem

      public void removeAllBootSystem()
      Information provided by the PKI file:
      
          \brief Removes all boot system images from this device.
          
              
      Specified by:
      removeAllBootSystem in interface CiscoDevice
    • getBootSystems

      public List<BootSystemEntry> getBootSystems()
      Information provided by the PKI file:
      
          \brief Returns the list of current boot system images.
          
          \return vector<string>, the list of current boot system images.
          
              
      Specified by:
      getBootSystems in interface CiscoDevice
      Returns:
      List<BootSystemEntry> Returns a List<BootSystemEntry>
    • getConfigRegister

      public Short getConfigRegister()
      Information provided by the PKI file:
      
          \brief Returns the current config register.
          
          \return short, the current config register.
          
              
      Specified by:
      getConfigRegister in interface CiscoDevice
      Returns:
      Short Returns a Short
    • setNextConfigRegister

      public void setNextConfigRegister(Short in_register)
      Information provided by the PKI file:
      
          \brief Sets the next config register.
          
          \param in_register, the next config register.
          
              
      Specified by:
      setNextConfigRegister in interface CiscoDevice
      Parameters:
      in_register - Takes in a parameter of in_register
    • getNextConfigRegister

      public Short getNextConfigRegister()
      Information provided by the PKI file:
      
          \brief Returns the next config register.
          
          \return short, the next config register.
          
              
      Specified by:
      getNextConfigRegister in interface CiscoDevice
      Returns:
      Short Returns a Short
    • setBannerMotd

      public void setBannerMotd(String banner)
      Information provided by the PKI file:
      
          \brief Sets the message of the day banner when the device boots.
          
          \param banner, the message of the day.
          
              
      Specified by:
      setBannerMotd in interface CiscoDevice
      Parameters:
      banner - Takes in a parameter of banner
    • getBannerMotd

      public String getBannerMotd()
      Information provided by the PKI file:
      
          \brief Returns the message of the day banner.
          
          \return string, the message of the day.
          
              
      Specified by:
      getBannerMotd in interface CiscoDevice
      Returns:
      String Returns a String
    • setTimeZone

      public void setTimeZone(String timeZone, Short hourOffset, Short minOffset)
      Information provided by the PKI file:
      
          \brief Sets the timezone for this device.
          
          \param timeZone, the timezone string.
          \param hourOffset, the hours offset from UTC.
          \param minOffset, the minutes offset from UTC.
          
              
      Specified by:
      setTimeZone in interface CiscoDevice
      Parameters:
      timeZone - Takes in a parameter of timeZone
      hourOffset - Takes in a parameter of hourOffset
      minOffset - Takes in a parameter of minOffset
    • getTimeZone

      public String getTimeZone()
      Information provided by the PKI file:
      
          \brief Returns the timezone of this device.
          
          \return string, the timezone of this device.
          
              
      Specified by:
      getTimeZone in interface CiscoDevice
      Returns:
      String Returns a String
    • getBia

      public MACAddress getBia()
      Information provided by the PKI file:
      
          \brief Returns the burned-in address of this device.
          
          \return mac, the burned-in address of this device.
          
              
      Specified by:
      getBia in interface CiscoDevice
      Returns:
      MACAddress Returns a MACAddress
    • setServicePasswordEncryption

      public void setServicePasswordEncryption(boolean bEnable)
      Information provided by the PKI file:
      
          \brief Enables or disables service password encryption.
          
          \param bEnable, true to enable service password encryption, false to disable it.
          
              
      Specified by:
      setServicePasswordEncryption in interface CiscoDevice
      Parameters:
      bEnable - Takes in a parameter of bEnable
    • getServicePasswordEncryption

      public boolean getServicePasswordEncryption()
      Information provided by the PKI file:
      
          \brief Returns true if service password encryption is enabled, otherwise false.
          
          \return bool, true if service password encryption is enabled, otherwise false.
          
              
      Specified by:
      getServicePasswordEncryption in interface CiscoDevice
      Returns:
      boolean Returns a boolean
    • getConsole

      public Port getConsole()
      Information provided by the PKI file:
      
          \brief Returns the console port of this device.
          
          \return Port, the console port object.
          
              
      Specified by:
      getConsole in interface CiscoDevice
      Returns:
      Port Returns a Port
    • getConsoleLine

      public TerminalLine getConsoleLine()
      Information provided by the PKI file:
      
          \brief Returns the console line of this device.
          
          \return TerminalLine, the console line TerminalLine object.
          
              
      Specified by:
      getConsoleLine in interface CiscoDevice
      Returns:
      TerminalLine Returns a TerminalLine
    • getVtyLine

      public TerminalLine getVtyLine(int num)
      Information provided by the PKI file:
      
          \brief Returns the vty line specified by num.
          
          \param num, the vty line number of interest.
          
          \return TerminalLine, the vty line TerminalLine object.
          
              
      Specified by:
      getVtyLine in interface CiscoDevice
      Parameters:
      num - Takes in a parameter of num
      Returns:
      TerminalLine Returns a TerminalLine
    • getLine

      public TerminalLine getLine(int num)
      Information provided by the PKI file:
      
          \brief Returns the line specified by num.
          
          \param num, the line number of interest.
          
          \return TerminalLine, the line TerminalLine object.
          
              
      Specified by:
      getLine in interface CiscoDevice
      Parameters:
      num - Takes in a parameter of num
      Returns:
      TerminalLine Returns a TerminalLine
    • getIpcTerminalLine

      public TerminalLine getIpcTerminalLine()
      Information provided by the PKI file:
      
          \brief Returns the IPC terminal line of this device.
          
          \return TerminalLine, the IPC TerminalLine object.
          
              
      Specified by:
      getIpcTerminalLine in interface CiscoDevice
      Returns:
      TerminalLine Returns a TerminalLine
    • enterCommand

      public Pair<CommandStatus,String> enterCommand(String commandStr, String modeStr)
      Information provided by the PKI file:
      
          \brief Enters the specified command in the specified mode to the terminal.
          
          \param commandStr   the command string.
          \param modeStr              the mode. Valid modes: user, enable, global.
          If blank, the command string will be entered into the current mode.
          
          \return pair<CommandStatus,  the status of the command entry.
          Valid command statuses:     eStatusOk = 0,
          eErrorAmbiguous = 1,
          eErrorInvalid = 2,
          eErrorIncomplete = 3,
          eErrorNotImplemented = 4
          
              
      Specified by:
      enterCommand in interface CiscoDevice
      Parameters:
      commandStr - Takes in a parameter of commandStr
      modeStr - Takes in a parameter of modeStr
      Returns:
      Pair<CommandStatus, String> Returns a Pair<CommandStatus, String>
    • isBooting

      public boolean isBooting()
      Information provided by the PKI file:
      
          \brief Checks whether the device is currently booting
          
              
      Specified by:
      isBooting in interface CiscoDevice
      Returns:
      boolean Returns a boolean
    • skipBoot

      public void skipBoot()
      Information provided by the PKI file:
      
          \brief Skips the booting process.
          
              
      Specified by:
      skipBoot in interface CiscoDevice
    • setFtpUsername

      public void setFtpUsername(String username)
      Information provided by the PKI file:
      
          \brief Sets the FTP username for the device.
          
          \param username, the desired FTP username for this device.
          
              
      Specified by:
      setFtpUsername in interface CiscoDevice
      Parameters:
      username - Takes in a parameter of username
    • setFtpPasswd

      public void setFtpPasswd(String passwd, int uType)
      Information provided by the PKI file:
      
          \brief Sets the FTP password for the device.
          
          \param passwd, the desired FTP password for this device.
          
          \param uType, whether the password is encrypted or not. 7 is encryped or 0 is unencrypted.
          
              
      Specified by:
      setFtpPasswd in interface CiscoDevice
      Parameters:
      passwd - Takes in a parameter of passwd
      uType - Takes in a parameter of uType
    • getFtpUsername

      public String getFtpUsername()
      Information provided by the PKI file:
      
          \brief Returns the FTP username for the device.
          
          \return string, the FTP username for this device.
          
              
      Specified by:
      getFtpUsername in interface CiscoDevice
      Returns:
      String Returns a String
    • getFtpPasswd

      public String getFtpPasswd()
      Information provided by the PKI file:
      
          \brief Returns the FTP password for the device.
          
          \return string, the FTP password for this device.
          
              
      Specified by:
      getFtpPasswd in interface CiscoDevice
      Returns:
      String Returns a String
    • clearFtpUsername

      public void clearFtpUsername()
      Information provided by the PKI file:
      
          \brief Clears the current FTP username.
          
              
      Specified by:
      clearFtpUsername in interface CiscoDevice
    • clearFtpPasswd

      public void clearFtpPasswd()
      Information provided by the PKI file:
      
          \brief Clears the current FTP password.
          
              
      Specified by:
      clearFtpPasswd in interface CiscoDevice
    • getUserPassCount

      public int getUserPassCount()
      Information provided by the PKI file:
      
          \brief Returns the number of authenticated users.
          
          \return int, the number of authenticated users.
          
              
      Specified by:
      getUserPassCount in interface CiscoDevice
      Returns:
      int Returns a int
    • addUserPassEntry

      public void addUserPassEntry(String username, String password, int type)
      Information provided by the PKI file:
      
          \brief Adds an authenticated user with the specified username, password, and type.
          
          \param username, the username for the authenticated user.
          \param password, the password for the authenticated user.
          \param type, the type for the user. The default is type 0.
          
              
      Specified by:
      addUserPassEntry in interface CiscoDevice
      Parameters:
      username - Takes in a parameter of username
      password - Takes in a parameter of password
      type - Takes in a parameter of type
    • removeUserPassEntry

      public void removeUserPassEntry(String username)
      Information provided by the PKI file:
      
          \brief Removes the authenticated user with the specified username.
          
          \param username, the username of the authenticated user of interest.
          
              
      Specified by:
      removeUserPassEntry in interface CiscoDevice
      Parameters:
      username - Takes in a parameter of username
    • getUserEntryAt

      public String getUserEntryAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the username of the authenticated user at the specified index.
          
          \param index, the index of the authenticated user of interest.
          
          \return string, the username of the authenticated user at the specified index.
          
              
      Specified by:
      getUserEntryAt in interface CiscoDevice
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • removeUserPassAt

      public void removeUserPassAt(int index)
      Information provided by the PKI file:
      
          \brief Removes the username of the authenticated user at the specified index.
          
          \param index, the index of the authenticated user of interest.
          
              
      Specified by:
      removeUserPassAt in interface CiscoDevice
      Parameters:
      index - Takes in a parameter of index
    • isUserExist

      public boolean isUserExist(String username)
      Information provided by the PKI file:
      
          \brief Returns true if the specified authenticated user exists, otherwise false.
          
          /param username, the username of the authenticated user of interest.
          
          \return bool, true if the specified authenticated user exists, otherwise false.
          
              
      Specified by:
      isUserExist in interface CiscoDevice
      Parameters:
      username - Takes in a parameter of username
      Returns:
      boolean Returns a boolean